var path = $("#path").val()
var brId=$("#Id_brId2").val()
var csId=$("#Id_csId").val()
var price=$("#Id_price").val()
var price1=$("#id_my_price_b").val()
var price2=$("#id_my_price_e").val()
var cGear=$("#id_cGear").val()
var cSeat=$("#id_cSeat").val()
var cCus=$("#id_cCus").val()
var cAge=$("#id_cAge").val()
var cMileage=$("#id_cMileage").val()
var csName=$("#id_csName").val()
var brNames=$("#id_brName").val()
var likeStr=$("#id_likeStr").val()
var orderPrice=$("#id_orderPrice").val()
var orderFar=$("#id_orderFar").val()
var orderAge=$("#id_orderAge").val()
var pageNow=$("#id_pageNow").val()
var pageSize=$("#id_pageSize").val()
var pageNums=$("#id_pageNums").val()
var or_far = $("#Or_far").prop("checked");
var or_age = $("#Or_age").prop("checked");
var order_price = $("#Order_price").prop("checked");



function selectBR(obj) {

    if(obj.tabIndex==-1){
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:"",csName:"",brName:"",csId:"",price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }else{
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:obj.tabIndex,csName:"",brName:obj.name,csId:"",price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }
}
function selectCS(obj) {
    if(obj.tabIndex==-1){
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:"",brName:brNames,csId:"",price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }else{
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:obj.name,brName:brNames,csId:obj.tabIndex,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }
}

function selectPrice(obj){
    if(obj.tabIndex==-1){
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:"",price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }else{
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:obj.tabIndex,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }

}
function selectPriceMiddle(){
    let priceLow=$("#my_price_b").val();
    let priceHeigh=$("#my_price_e").val();
    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:brId,csName:csName,brName:brNames,csId:csId,price:"",price1:priceLow,price2:priceHeigh,
            cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
            orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

}


function selectGear(obj) {

    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
            cGear:obj.name,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:cMileage,likeStr:"",
            orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});


}

function selectCus(obj){
    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
            cGear:cGear,cSeat:cSeat,cCus:obj.name,cAge:cAge,cMileage:cMileage,likeStr:"",
            orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    //
}


function selectFar(obj){

    if(obj.tabIndex==-1){
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:"",likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }else{
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:cAge,cMileage:obj.tabIndex,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }

}

function selectAge(obj){
    if(obj.tabIndex==-1){
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge:"",cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }else{
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: obj.tabIndex,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }

}

function selectSeat(obj){
    if(obj.tabIndex==-1){
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:"",cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }else{
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:obj.tabIndex,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }

}


function searchText() {
    let text=$("#searchText").val()
    // alert("text"+text)
    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:"",csName:"",brName:"",csId:"",price:"",price1:"",price2:"",
            cGear:"",cSeat:"",cCus:"",cAge: "",cMileage:"",likeStr:text,
            orderPrice:"",orderFar:"",orderAge:"",pageNow:1,pageSize:pageSize,pageNums:pageNums
        });
}


function orderByPriceBox() {
    if(order_price==true){
        order_price=false
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:"",orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }else{
        order_price=true
        orderPrice=1
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }

}
function orderByPrice() {
    if(order_price==false){
        alert("请先勾选！")
        return
    }


    if (orderPrice==null ||orderPrice == 1) {
        orderPrice = -1;
    } else {
        orderPrice = 1;
    }

    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
            cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
            orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});


}

function orderByFarBox() {
    if(or_far==true){
        or_far=false
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:"",orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

    }else{
        or_far=true
        orderFar=1;
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }

}

function orderByFar() {
    if(or_far==false){
        alert("请先勾选！")
        return
    }
    if(orderFar==null || orderFar == 1){
        orderFar=-1;
    }else{
        orderFar=1;
    }
    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
            cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
            orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

}


function orderByAgeBox() {
    if(or_age==true){
        or_age=false
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:"",pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }else {
        or_age=true
        orderAge=1
        $("#content").load(path+"/carDetail/buyCar/carInfo",
            {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
                cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
                orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});
    }
}
function orderByAge() {
    if(or_age==false){
        alert("请先勾选")
        return
    }

    if(orderAge==null || orderAge == 1){
        orderAge=-1;
    }else{
        orderAge=1;
    }

    $("#content").load(path+"/carDetail/buyCar/carInfo",
        {brId:brId,csName:csName,brName:brNames,csId:csId,price:price,price1:price1,price2:price2,
            cGear:cGear,cSeat:cSeat,cCus:cCus,cAge: cAge,cMileage:cMileage,likeStr:"",
            orderPrice:orderPrice,orderFar:orderFar,orderAge:orderAge,pageNow:1,pageSize:pageSize,pageNums:pageNums});

}
